﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>使用DOM获取页面中某控件的属性</title>
    <script type="text/javascript">
        function  testa(){
            var mydom = document.getElementById("btn");
            var myattri = mydom.getAttribute("type");
            alert("按钮的英文类型是："+myattri);
        }
    </script>
</head>
<body>
<form id="form1" runat="server">
    <input id="btn" type="button" value="test" onclick="testa()">
</form>
</body>
</html>